package com.lhl.jpa.domain;

import io.swagger.annotations.Api;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @className: com.lhl.jpa.domain.TennisPlayer
 * @description: TODO 类描述
 * @author: king
 * @date: 2021-02-05 16:45
 **/
@Api(tags = "TennisPlayer", produces = "TennisPlayer")
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString(exclude = "tournament")
public class TennisPlayer implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    private String name;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "TOURNAMENT_ID")
    private Tournament tournament;

    public TennisPlayer(String name) {
        this.name = name;
    }
}
